package com.steel.yfmall.cloud.assistant.utils.constants;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @version 1.0
 * @ClassName: EnumZgAPINames
 * @author: TQ
 * @Description: DOTO
 * @Date Create in 17:45 2020/11/19
 **/
@Getter
public enum EnumZgAPINames {

    SO01("SO01", "订单建立", "so", 1),
    SO03("SO03", "订单确认通知", "so", 2),
    SO05("SO05", "合同建立", "so", 3),
    SR01("SR01", "查询价格", "sr", 4),
    SO12("SO12", "打印订单合同模板", "so", 5),
    GET_CAN_INVOICE_LIST_BY_ORDER_NO("getCanInvoiceListByOrderNo", "通过订单号获取应付单", "av", 6),
    SET_DETAIL_OR_SUM_DATA("setDetailOrSumData", "设置开明细票OR汇总票", "av", 7),
    APPLY_INVOICE_OK("applyInvoiceOk", "申请确认", "av", 8),
    CUST_NO_DATA_UPDATE("custNoDataUpdate", "修改发票接收人资料", "av", 9),
    SSKEC007("SSKEC007", "通过订单号与客户编号，查询结算结果", "sa", 10),
    CANCEL_ORDER_CONFIRM("cancelOrderConfirm", "中冠订单取消确认", "so", 11),
    ORDER_SHOW_PDF("orderShowPdf", "合同预览", "so", 12),
    AR03("AR03", "查询运费余额", "ar", 13),
    CREATE_CONTRACT_CHANGE("createContractChange", "框架合同变更", "so", 14),
    SSKEC008("SSKEC008", "通过客户编码，查询账户余额", "sa", 15),
    TO_ADD_CUSTOMER("toAddCustomer", "金蝶添加企业客户信息", "ormrpc", 16),
    SB03("SB03", "新增收货地址联系人", "sb", 16),
    ;

    /**
     * 编码
     */
    private String zgApiNameCode;

    /**
     * 描述
     */
    private String zgApiNameTitle;

    /**
     * 系统类型
     */
    private String zgApiNameSystemCode;

    /**
     * 游标
     */
    private int zgApiNameIndex;

    EnumZgAPINames(String zgApiNameCode, String zgApiNameTitle, String zgApiNameSystemCode, int zgApiNameIndex) {
        this.zgApiNameCode = zgApiNameCode;
        this.zgApiNameTitle = zgApiNameTitle;
        this.zgApiNameSystemCode = zgApiNameSystemCode;
        this.zgApiNameIndex = zgApiNameIndex;
    }

    /**
     * 获取编码
     *
     * @param zgApiNameCode 匹配编码
     * @return EnumCardType
     */
    public static EnumZgAPINames getEnumApplyType(String zgApiNameCode) {
        for (EnumZgAPINames itemBean : EnumZgAPINames.values()) {
            if (StringUtils.equalsIgnoreCase(zgApiNameCode, itemBean.getZgApiNameCode())) {
                return itemBean;
            }
        }
        return null;
    }

}
